package com.nyist.service;

import com.nyist.result.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "CLOUD-PROVIDER")
public interface UserService {
    /**
     * 可以直接放controller 或者 com.nyist.service
     */

    @GetMapping(value = "/provider/hello/{name}")
    public CommonResult hello(@PathVariable("name") String name);

    /**
     * openfegin 默认超时时间为 1 秒
     * @return
     */
    @GetMapping(value = "/provider/openfegin/timeout")
    public String getOpenFeginTimeOut();

}
